class myThread extends Thread{
    public static int num=1;
    @Override
    public void run(){
        System.out.print(num+++" ");
    }
}
public class demo02 {
    public static void main(String[] args) throws InterruptedException {
        myThread t1=new myThread();
        myThread t2=new myThread();
        myThread t3=new myThread();
        myThread t4=new myThread();
        myThread t5=new myThread();
        myThread t6=new myThread();
        myThread t7=new myThread();
        myThread t8=new myThread();
        myThread t9=new myThread();
        myThread t10=new myThread();
        myThread t11=new myThread();
        myThread t12=new myThread();
        myThread t13=new myThread();
        myThread t14=new myThread();
        myThread t15=new myThread();
        myThread t16=new myThread();
        myThread t17=new myThread();
        myThread t18=new myThread();
        myThread t19=new myThread();
        myThread t20=new myThread();
        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();
        t6.start();
        t7.start();
        t8.start();
        t9.start();
        t10.start();
        t11.start();
        t12.start();
        t13.start();
        t14.start();
        t15.start();
        t16.start();
        t17.start();
        t18.start();
        t19.start();
        t20.start();
        t1.join();
        t2.join();
        t3.join();
        t4.join();
        t5.join();
        t6.join();
        t7.join();
        t8.join();
        t9.join();
        t10.join();
        t11.join();
        t12.join();
        t13.join();
        t14.join();
        t15.join();
        t16.join();
        t17.join();
        t18.join();
        t19.join();
        t20.join();
        System.out.println("ok");
    }
}
